package com.deepocean.service.impl;

import com.deepocean.dao.MagneticSeparatorDao;
import com.deepocean.entity.MagneticSeparatorCondition;
import com.deepocean.entity.MagneticSeparatorEntity;
import com.deepocean.entity.MagneticSeparatorInAndOut1Hour;
import com.deepocean.service.IMagneticSeparatorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class MagneticSeparatorServiceImpl implements IMagneticSeparatorService {
    @Autowired
    MagneticSeparatorDao magneticSeparatorDao;
    @Override
    public boolean add(MagneticSeparatorEntity magneticSeparatorEntity) {
        magneticSeparatorEntity.setId(UUID.randomUUID().toString().replaceAll("-", ""));
        return magneticSeparatorDao.add(magneticSeparatorEntity);
    }

    @Override
    public MagneticSeparatorInAndOut1Hour getInAndOutInHour(String deviceId) {
        return magneticSeparatorDao.getInAndOutInHour(deviceId);
    }

    @Override
    public List<MagneticSeparatorEntity> getMagneticSeparatorByCondition(MagneticSeparatorCondition magneticSeparatorCondition) {
        return magneticSeparatorDao.getMagneticSeparatorByCondition(magneticSeparatorCondition);
    }
}
